package com.example.shop_2207.database

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.example.shop_2207.entity.CarEntity

@Dao
interface OrderDao {
    //生成订单
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertOrder(carEntity: CarEntity)
    //修改订单
    @Update
    fun updateOrder(carEntity: CarEntity)
    //展示订单---查询某种状态的订单
    @Query("select * from `order` where order_status = :status")
    fun queryOrder(status:Int):List<CarEntity>
    //查询全部订单
    @Query("select * from `order`")
    fun queryAll():List<CarEntity>
    //删除订单

}